<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<style>
		#child{
			width:100%;
			height:600px;
		}
	</style>
	<body>
		<h1 id="color">第一个页面</h1>
		<div id="data"></div>
		<div>
			<iframe id="child" src="http://www.shisongyan.top/"></iframe>
		</div>
	</body>
	<script>
	
		var win = window.open('3.html', '_blank');	
		setInterval(function(){
			var message = Math.random();
			win.postMessage(message,'http://127.0.0.1:8020');
		},10000)
		
		
		window.addEventListener('message',function(evt){
			console.log(evt)
			data.innerHTML += "<h3>"+evt.data+"</h3>"
		})
	</script>
</html>
